<?php
$this->pageTitle = Yii::t('view', 'Izin');
$this->breadcrumbs=array(
	Yii::t('view', 'Data Tabular'),
);
?>
<div class="container">
    <div class="row">
        <div class="col-md-2">
            <?php if(Yii::app()->user->isOperatorMB() || Yii::app()->user->isOperator() || Yii::app()->user->isAdmin()):?>
            <div class="col-md-12 mini-bot-pad">
                <a href="<?php echo Yii::app()->createUrl('/izin/index/1')?>">
                    <img src="<?php echo Yii::app()->theme->baseUrl; ?>/assets/images/pmb.png" class="img-responsive">
                </a>
            </div>
            <?php endif;?>
            <?php if(Yii::app()->user->isOperatorGB() || Yii::app()->user->isOperator() || Yii::app()->user->isAdmin()):?>
            <div class="col-md-12 mini-bot-pad">
                <a href="<?php echo Yii::app()->createUrl('/izin/index/2')?>">
                    <img src="<?php echo Yii::app()->theme->baseUrl; ?>/assets/images/pgb.png" class="img-responsive">
                </a>
            </div>
            <?php endif;?>
            <?php if(Yii::app()->user->isOperatorHO() || Yii::app()->user->isOperator() || Yii::app()->user->isAdmin()):?>
            <div class="col-md-12 mini-bot-pad">
                <a href="<?php echo Yii::app()->createUrl('/izin/index/3')?>">
                    <img src="<?php echo Yii::app()->theme->baseUrl; ?>/assets/images/pho.png" class="img-responsive">
                </a>
            </div>
            <?php endif;?>
            <div class="col-md-12 mini-bot-pad">
                <a class="btn btn-lg btn-default" href="<?php echo Yii::app()->createUrl('/izin/')?>">
                    <?php echo Yii::t('view', 'Semua Data')?>
                </a>
            </div>
            <div class="col-md-12 mini-bot-pad btn-peta-tab">
                <a class="btn btn-lg btn-default" href="<?php echo Yii::app()->createUrl('/')?>">
                    <?php echo Yii::t('view', 'Peta')?>
                </a>
            </div>
        </div>
        <div class="col-md-10">     
            <div class="panel panel-default">
              <div class="panel-heading">
                <h3 class="panel-title"><?php echo $jenisUsahaAlias;?></h3>
              </div>
              <div class="panel-body">
                  <?php //echo CHtml::link(Yii::t('view','Cetak Data Perizinan'), 'javascript:{}', array('class'=>'btn btn-primary','data-toggle'=>'modal', 'data-target'=>'#myModal'))?>
                  <?php //echo CHtml::link('Download Checklist', 'izin/downloadChecklist', array('class'=>'btn btn-primary'))?>
                <?php $this->widget('booster.widgets.TbGridView',array(
                    'id'=>Yii::app()->controller->id.'-grid',
                    'type' => 'striped bordered condensed',
                    'dataProvider' => $model->search(),
                    'filter' => $model,
                    'responsiveTable' => true,
                    'columns' => $this->getIndexList($model),
                )); 
                ?>
              </div>
            </div>
        </div>
    </div>
    
 <div class="modal fade in" id="myModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="false">
  <div class="modal-backdrop fade in"></div>
     <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
        <h4 class="modal-title" id="exampleModalLabel"><?php echo Yii::t('view','Cetak Data Perizinan');?></h4>
      </div>
      <div class="modal-body">
        <?php $form=$this->beginWidget('booster.widgets.TbActiveForm',array(
                'id'=>Yii::app()->controller->id.'-form',
                'enableAjaxValidation' => false,
                'type' => 'horizontal',
                'action'=>Yii::app()->createUrl('izin/export'),
                'htmlOptions' => array(
                    'class' => 'form',
                ),
        )); ?>
        <?php echo $form->errorSummary($model); ?>
        <?php 
            echo $form->dropDownListGroup($model, 'jenis_usaha', array('wrapperHtmlOptions' => array('class' => 'col-md-8'), 'labelOptions' => array('class' => 'col-md-2'), 'widgetOptions' => array('data' => array('Pengolahan MB'=>'Pengolahan Minyak Bumi','Pengolahan GB'=>'Pengolahan Gas Bumi','Pengolahan HO'=>'Pengolah Hasil Olahan'), 'htmlOptions' => array('empty' => Yii::t('app', 'Pilih Jenis Usaha..'),'class' => 'form-control')))); 
            echo $form->dropDownListGroup($model,'status_izin', array('wrapperHtmlOptions'=>array('class'=>'col-md-8'),'labelOptions'=>array('class'=>'col-md-2'),'widgetOptions'=>array('data'=>array("Dalam Proses"=>"Dalam Proses","Masih Berlaku"=>"Masih Berlaku","Kadaluarsa"=>"Kadaluarsa",), 'htmlOptions'=>array('empty' => Yii::t('app', 'Pilih Status Izin..'),'class'=>'form-control')))); 
        ?>
      </div>
      <div class="modal-footer">
         <?php
                $this->widget('booster.widgets.TbButton', array(
                    'buttonType' => 'submit',
                    'context' => 'primary',
                    'label' => Yii::t('app', 'Export'),
                ));
                ?>
                <?php
                $this->widget('booster.widgets.TbButton', array(
                    'buttonType' => 'reset',
                    'context' => 'danger',
                    'label' => Yii::t('app', 'Batal'),
                    'htmlOptions' => array('data-dismiss'=>'modal'),
                ));
                ?>
      </div>
    <?php $this->endWidget(); ?>
    </div>
  </div>
</div>